#include <cstdio>
#include <queue>

using namespace std;

bool check( int n, int &a )
{
    int p = n;
    a = 0;
    while ( n )
    {
        a = a * 10 + n % 10;
        n /= 10;
    }
    return a != p;
}

int main( )
{
    int n, c, a;
    queue<int> s;
    while ( scanf("%d", &n) != EOF )
    {
        c = 0;
        s.push( n );
        while ( check( n, a ) )
        {
            n += a;
            s.push( n );
            c++;
        }
        printf("%d\n", c);
        printf("%d", s.front( ));
        s.pop( );
        while ( !s.empty( ) )
        {
            printf("--->%d", s.front( ));
            s.pop( );
        }
        printf("\n");
    }
    return 0;
}
